POV-Ray : Newsgroups : povray.advanced-users : Bounding with a sky_sphere : Re: Bounding with a sky_sphere Server Time
2 Nov 2024 07:26:20 EDT (-0400)
  Re: Bounding with a sky_sphere  
From: Disnel
Date: 17 Feb 2000 10:06:54
Message: <38AC138C.A5645660@linux.itam.cas.cz>
Instead of bounding, try use #if directive and cut off
objects too distant from camera, something like:

#declare MaximumDistance= something

#declare CameraPos= <bla, bla, bla>

#macro dist(v1, v2)
  #local dx=v2.x-v1.x;
  #local dy=v2.y-v1.y;
  #local dz=v2.z-v1.z;
  ( sqrt(dx*dx + dy*dy +dz*dz) )
#end

...


#declare Building1=
object {
   ...
}
#declare Building1pos= <bla, bla, bla>

#if (dist(CameraPos, Building1Pos) < MaximumDistance)
   object { Building1 translate Building1pos }
#end

Maybe I make some mistake in syntax, but idea is clear, hopefully

Or you can enclose entire object definition in #if statement,
you will then improve parsing time too.

Disnel

E-Mail:   dis### [at] itamcascz
Homepage: http://www.itam.cas.cz/~disnel
ICQ:      20126042


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.